﻿/***************************************************************************

Copyright (c) Microsoft Corporation. All rights reserved.
This code is licensed under the Visual Studio SDK license terms.
THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

***************************************************************************/

using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Project;
using rfc1459.PS3Project.EditorIntegration;

namespace rfc1459.PS3Project
{
    /// <summary>
    /// This class implements the package exposed by this assembly.
    /// </summary>
    /// <remarks>
    /// <para>A Visual Studio component can be registered under different registry roots; for instance
    /// when you debug your package you want to register it in the experimental hive. This
    /// attribute specifies the registry root to use if no one is provided to regpkg.exe with
    /// the /root switch.</para>
    /// <para>A description of the different attributes used here is given below:</para>
    /// <para>DefaultRegistryRoot: This defines the default registry root for registering the package. 
    /// We are currently using the experimental hive.</para>
    /// <para>ProvideObject: Declares that a package provides creatable objects of specified type.</para> 
    /// <para>ProvideProjectFactory: Declares that a package provides a project factory.</para>
    /// <para>ProvideProjectItem: Declares that a package provides a project item.</para> 
    /// </remarks>  
    [PackageRegistration(UseManagedResourcesOnly = true)]
    [DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\10.0")]
    [ProvideObject(typeof(GeneralPropertyPage))]
    [ProvideProjectFactory(typeof(PlaystationProjectFactory), "Playstation Project", "Playstation Project Files (*.psproj);*.psproj", "psproj", "psproj", @"Templates\Projects\PlaystationProject", LanguageVsTemplate = "PlaystationProject", NewProjectRequireNewFolderVsTemplate = false)]
    [ProvideProjectItem(typeof(PlaystationProjectFactory), "Playstation Items", @"Templates\ProjectItems\PlaystationProject", 500)]
    [ProvideEditorExtension(typeof(PlaystationEditorFactory), ".p3p", 256)]
    [ProvideEditorLogicalView(typeof(PlaystationEditorFactory), "{7651A703-06E5-11D1-8EBD-00A0C90F26EA}")]
    [Guid(GuidStrings.GuidPlaystationProjectPkgString)]
    public sealed class PlaystationProjectPackage : ProjectPackage
    {
        #region Overridden Implementation
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initilaization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            this.RegisterProjectFactory(new PlaystationProjectFactory(this));
            this.RegisterEditorFactory(new PlaystationEditorFactory(this));
        }

        public override string ProductUserContext
        {
            get { return "psproj"; }
        }

        #endregion
    }
}
